<?php
$num_rules = 20000;
if($_GET['num_rules'])
	$num_rules = $_GET['num_rules'];

$group_size = $num_rules;
if($_GET['group_size'])
	$group_size = $_GET['group_size'];

echo "
	:- export p/2. <br />
	:- uindex(p/2, trie). <br />
	:- import call0/1 from machine. <br /><br />
";

$j = 1;
for($i = 1; $i <= $num_rules; $i++) {
	echo 'p(a' . $j . ',b' . $i . ') :- q(b' . $i . ').<br />';
	if($i % $group_size == 0) $j++;
}

echo "q(_).";
?>
